<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Value at Risk Calculation in Lognormal Approximation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>

<table width="100%" summary="page for VaR.norm {VaR}"><tr><td>VaR.norm {VaR}</td><td align="right">R Documentation</td></tr></table>
<h2>Value at Risk Calculation in Lognormal Approximation</h2>


<h3>Description</h3>

<p>
This function estimates Value of Risk (VaR) value in lognormal approximation.
</p>


<h3>Usage</h3>

<pre>
VaR.norm(ydat, p = 0.99, dt = 1, type = "long", drift.appx = FALSE, lin.appx = TRUE)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>ydat</code></td>
<td>
Numeric vector of data for which VaR is to be calculated</td></tr>
<tr valign="top"><td><code>p</code></td>
<td>
Confidence level for VaR calculation</td></tr>
<tr valign="top"><td><code>dt</code></td>
<td>
Liquidation period</td></tr>
<tr valign="top"><td><code>type</code></td>
<td>
String describing type of VaR calculated: "long" or "short"</td></tr>
<tr valign="top"><td><code>drift.appx</code></td>
<td>
Logical; if <code>TRUE</code> VaR is calculated in non-zero drift approximation </td></tr>
<tr valign="top"><td><code>lin.appx</code></td>
<td>
Logical; if <code>TRUE</code> VaR is calculated in linear approximation </td></tr>
</table>

<h3>Details</h3>

<p>
This function estimates VaR for a single risk factor <i>S(t)</i> in lognormal approximation. 
The final expression for VaR of {bf long} and {bf short} position is 
</p><p align="center"><i>VaR_{long}(c)=S(t)[1-exp(&mu; delta t + Q^{N(0,1)}_{1-c} &sigma; sqrt{delta t})]</i></p><p align="center"><i>VaR_{short}(c)=-S(t)[1-exp(&mu; delta t - Q^{N(0,1)}_{1-c} &sigma; sqrt{delta t})]</i></p><p>
Here, <i>c</i> is a desired confidence, <i>Q^{N(0,1)}_{1-c}</i> is a <i>1-c</i> percentile of normal
distribution, <i>delta t</i> is liquidation period, and parameters <i>&mu;</i> and <i>&sigma;</i> are
mean value (or drift) and standard deviation of <i>delta S(t)</i>.
If <code>drift.appx</code>=<code>FALSE</code>, <i>&mu; = 0</i>. If <code>lin.appx</code>=<code>TRUE</code>, the above functions are expanded 
according <i>exp(x) = 1+x</i>.
</p>


<h3>Value</h3>

<p>
Return value is a list containing following components:
</p>
<table summary="R argblock">
<tr valign="top"><td><code>VaR</code></td>
<td>
Value at Risk for input data</td></tr>
<tr valign="top"><td><code>data</code></td>
<td>
Input data</td></tr>
<tr valign="top"><td><code>cdata</code></td>
<td>
Log-transformed data</td></tr>
<tr valign="top"><td><code>liq.period</code></td>
<td>
Same as <code>dt</code></td></tr>
<tr valign="top"><td><code>type</code></td>
<td>
Same as <code>type</code></td></tr>
<tr valign="top"><td><code>conf.level</code></td>
<td>
Same as <code>p</code></td></tr>
<tr valign="top"><td><code>mean</code></td>
<td>
Mean value of <code>cdata</code></td></tr>
<tr valign="top"><td><code>std</code></td>
<td>
Standard deviation of <code>cdata</code></td></tr>
</table>

<h3>Author(s)</h3>

<p>
T. Daniyarov
</p>


<h3>References</h3>

<p>
Deutsch, H.P., Derivatives and Internal Models, 2nd Edition, Palgrave, London 2001
</p>


<h3>See Also</h3>

<p>
<code><a href="VaR.norm.plots.html">VaR.norm.plots</a></code>, <code><a href="VaR.backtest.html">VaR.backtest</a></code>
</p>


<h3>Examples</h3>

<pre>
data(exchange.rates)
attach(exchange.rates)
y &lt;- USDJPY[!is.na(USDJPY)]
z &lt;- VaR.norm(y)
z$VaR
detach(exchange.rates)
</pre>



<hr><div align="center">[Package <em>VaR</em> version 0.2 <a href="00Index.html">Index</a>]</div>

</body></html>
